﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/Admin.Master" ValidateRequest="false" CodeBehind="EditForums.aspx.cs" Inherits="NEWS.Admin.EditForums" %>
<%@ Register Assembly= "msgBox" Namespace="BunnyBear" TagPrefix="cc1" %>

<asp:Content ID="content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">

function confirmAction() {
    if(confirm('Tất cả bình luận của tin này sẽ bị xóa \n Bạn có chắc chắn muốn xóa???')) {
        // you clicked the OK button.
        // you can allow the form to post the data.
        return true;
    }
    else {
      
       
        // you clicked the Cancel button.
        // you can disallow the form submission.
        return false;
    }
}

</script>

    <link rel="stylesheet" type="text/css" href="css/forums.css" />
    <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
        <ContentTemplate>
    <div class="dashboard">
        <% string mode = Request.QueryString["id"];
           int idforumnews = Convert.ToInt32(mode);
           var objectForums = HousingInfo.Library.ForumNewsBO.GetForumNewsBO(idforumnews);   
        %>
        <% string modecategory = Request.QueryString["categoryid"];
           int idcategory = Convert.ToInt32(modecategory);
           var objectCategory = HousingInfo.Library.SubTopicForumBO.GetSubTopicForumBO(idcategory);
           var objectCate_Parrent = HousingInfo.Library.CategoryBO.GetCategoryBO(Convert.ToInt32(objectCategory.CategoryID));  
        %>
			<div class="clearfix" id="ketquatimkiem">
				<div>
					<table class="binhluan">
						<tbody><tr>
							<td>								
                                <a href="PostForum.aspx">
									<img height="42" border="0" align="left" width="150" src="img/new_thread.gif"/>
								</a>
							</td>
							<%
							if (objectCategory.IsActive == true && objectCate_Parrent.IsActive == true)
                                { %>    
                                <td>
								    <a href="PostComment.aspx?idforum=<%=objectForums.ForumNewID %>">
									    <img height="42" border="0" align="left" width="150" src="img/reply_new.gif" />
								    </a>
							    </td>
								<%}%>
							
						</tr>
					</tbody></table>
				</div>
				<div class="box02_title">
					<table cellspacing="5" cellpadding="1" border="0">
						<tbody><tr valign="bottom">
							
							<td><a href="#">
								<img border="0" title="Go Back" src="img/navbits_start.gif" alt="Go Back"></a>
							</td>
							<td>&nbsp;</td>
							<td width="100%">
								<span class="navbar"><a href="Forums.aspx" accesskey="1">Diễn đàn nhà đất</a></span>
								<% if (objectCategory != null)
           {
               if (objectCategory.IsActive == true && objectCate_Parrent.IsActive ==true)
               { %>   
								                        <span class="navbar">&gt; 
								                            <a href="#"><%=objectCate_Parrent.CategoryName%></a>&gt; 
								                            <a href="#"><%=objectCategory.SubTopicForumName%></a>
								                        </span> 
								                        <%}
               else
               { %>
								                        <span class="navbar">&gt; 
								                            <a href="#"><%=objectCate_Parrent.CategoryName%></a>&gt; 
								                            <a href="#"><%=objectCategory.SubTopicForumName%> (Chủ đề này đã bị khóa)</a>
								                        </span> 
								                        <%}
           } %>
							</td>
						</tr>
						<tr>
							<td class="navbar" style="font-size: 10pt; padding-top: 1px;" colspan="3">
								<img border="0" title="Xem Thống Kê Mới" class="inlineimg" src="img/navbits_finallink_ltr.gif" alt="Xem Thống Kê Mới">
								<% if (objectForums != null)
           { %>
								        <strong><%=objectForums.Title%></strong>
								    <%}
           else
           { %>
								        <strong>Tin Này Không Tồn Tại</strong>
								    <%} %>
							</td>
						</tr>
					</tbody></table>
		
				</div>
			</div>
				
			<div class="clearfix" id="ketquatimkiem">			
				<table cellspacing="0" cellpadding="4" border="0" width="100%" id="post5215613">
					<tbody>
						<tr>							
							<td class="thead_binhluan">
								<a name="post5215613">
									<img border="0" title="Old" class="inlineimg" src="img/post_old.gif" alt="Old">
								</a>								
								&nbsp;&nbsp;<%=Convert.ToDateTime(objectForums.CreatedDate).ToString("dd/MM/yyyy HH:mm")%>
							</td>
							<td align="right" class="thead_binhluan">								
							</td>							
						</tr>
						<tr valign="top">
							<td width="180" class="tdprofile" rowspan="2">
								<div class="divprofile">			
									<div id="postmenu_5215613"> 										
										<a class="bigusername" href="#" title="Ten User"><%=objectForums.UserName%></a>										
									</div>
									<div style="margin-top: 7px;">
										<a href="#"><img border="0" title="user's Avatar" src="img/no_avarta.gif" alt="vitmaroc1989hcm's Avatar"></a>
									</div>
											
								</div>
								<div class="user_info">					
									<table>
										<tbody><tr>
											<td>Tham gia</td>
											<% var objectUser = HousingInfo.Library.UserBO.GetUserBO(objectForums.UserName); %>
											<td>: <%=Convert.ToDateTime(objectUser.RegisterDate).ToShortDateString()%></td>
										</tr>
									</tbody></table>										
								</div>
							</td>							
							<td class="tdtieude">							
								<div class="post_body">
									<div class="smallfont">
										<img border="0" title="Mặc định" class="inlineimg" src="img/icon1.gif" alt="Mặc định">										
										<%=objectForums.Title%>
									</div>
										<hr size="1" class="hrtieude">
									<div id="post_message_5215613">									
										<font color="DarkSlateGray">
										<%=objectForums.ForumNewsContent%>
										</font>
									</div>
								</div>								
								<div class="forumcomment_edit">	
								    <div class="buttonright">								        
                                        <asp:ImageButton ID="btnxoa" runat="server" style="margin:0px; padding:0px;"  OnClientClick="javascript:return confirmAction();" ImageUrl="img/edit.gif" 
                                             OnClick="btnxoa_Click" />
								    </div>
								  <% if (objectCategory.IsActive == true && objectCate_Parrent.IsActive == true)
             { %>
                                     <div class="buttonright">
								        <a href="PostComment.aspx?idforum=<%=objectForums.ForumNewID %>&qouteforum=<%=objectForums.ForumNewID %>">
									    <img border="0" align="left" src="img/quote.gif" />
								        </a>	
								        <a href="PostForum.aspx?id=<%=objectForums.ForumNewID %>">
									    <img border="0" align="left" src="img/edit.gif" />
								        </a>	
								    </div>
								    <%} %>								    												                                    	
								</div>
								<div class="smallfont">
									<hr size="1" class="hrtieude">
									<em>										
										Nội dung được thay đổi lan cuoi:
										<%=Convert.ToDateTime(objectForums.UpdatedDate).ToShortDateString()%> lúc 
										<span class="time"><%=Convert.ToDateTime(objectForums.UpdatedDate).ToString("HH:mm")%></span>.							
									</em>
								</div>
							</td>
						</tr>
						<tr>								
							<td align="right" valign="middle" class="tdbottom">							
							</td>
						</tr>
					</tbody>		
				</table>			
			</div>
		 <% if (HousingInfo.Library.ForumCommentBOList.CheckForumComment_ByIDForum(objectForums.ForumNewID))
      {
          var objectforumcomment = HousingInfo.Library.ForumCommentBOList.GetForumCommentBOList_ByID(objectForums.ForumNewID);

          foreach (var objforumcomment in objectforumcomment)
          {                                            
        %>
			<div class="clearfix" id="ketquatimkiem">			
				<table cellspacing="0" cellpadding="4" border="0" width="100%" id="Table1">
					<tbody>
						<tr>							
							<td class="thead_binhluan">
								<a name="post5215613">
									<img border="0" title="Old" class="inlineimg" src="img/post_old.gif" alt="Old">
								</a><%=Convert.ToDateTime(objforumcomment.CreatedDate).ToString("dd/MM/yyyy HH:mm")%>
							</td>
							<td align="right" class="thead_binhluan">								
							</td>							
						</tr>
						<tr valign="top">
							<td width="180" class="tdprofile" rowspan="2">
								<div class="divprofile">			
									<div id="Div1"> 										
										<a class="bigusername" href="#" title="Ten User"><%=objforumcomment.UserName%></a>										
									</div>
									<div style="margin-top: 7px;">
										<a href="#"><img border="0" title="vitmaroc1989hcm's Avatar" src="img/no_avarta.gif" alt="vitmaroc1989hcm's Avatar"></a>
									</div>
											
								</div>
								<div class="user_info">					
									<table>
										<tbody><tr>
											<td>Tham gia</td>
											<% var objectUserByComment = HousingInfo.Library.UserBO.GetUserBO(objforumcomment.UserName); %>
											<td>: <%=Convert.ToDateTime(objectUserByComment.RegisterDate).ToShortDateString()%></td>
										</tr>
									</tbody></table>										
								</div>
							</td>							
							<td class="tdtieude">							
								<div class="post_body">
									<div class="smallfont">
										<img border="0" title="Mặc định" class="inlineimg" src="img/icon1.gif" alt="Mặc định">										
										<%=objforumcomment.ForumCommentTitle%>
									</div>
										<hr size="1" class="hrtieude">
									<div id="Div2">									
										<font color="DarkSlateGray">
										<%=objforumcomment.CommentContent%>
										</font>
									</div>
								</div>
								<div class="forumcomment_edit">		
								    <div class="buttonright">
								        <a href="EditForums.aspx?categoryid=<%=modecategory %>&id=<%=mode %>&deletecomment=<%=objforumcomment.ForumCommentID %>">
									    <img border="0" align="left" src="img/edit.gif" />
								        </a>
								    </div>							    
								    <% if (objectCategory.IsActive == true && objectCate_Parrent.IsActive == true)
               { %>
                                    <div class="buttonright">																				
                                        <a href="PostComment.aspx?idforum=<%=objectForums.ForumNewID %>&qoutecomment=<%=objforumcomment.ForumCommentID %>">
									    <img border="0" align="left" src="img/quote.gif" />
								        </a>	
								        <a href="PostComment.aspx?id=<%=objforumcomment.ForumCommentID %>">
									    <img border="0" align="left" src="img/edit.gif" />
								        </a>
								    </div>
								    <%} %>	
								    
								</div>
								<div class="smallfont">
									<hr size="1" class="hrtieude">
									<em>										
										Nội dung được thay đổi lần cuối
										<%=Convert.ToDateTime(objforumcomment.UpdatedDate).ToShortDateString()%> 
                                    lúc 
										<span class="time"><%=Convert.ToDateTime(objforumcomment.UpdatedDate).ToString("HH:mm")%></span>.							
									</em>
								</div>								
							</td>
						</tr>
						<tr>								
							<td align="right" valign="middle" class="tdbottom">							
							</td>
						</tr>
					</tbody>		
				</table>			
			</div>
			<%}
      } %>
    </div>
  </ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

